Data smoothing

ABSTRACT

A method of transforming an array X of input values x (i)  into an array Y of output values y (i) , the method comprising calculating each value y (i)  of the array Y as a function of at least an exponentially weighted moving average a (i)  of the array X, calculated in ascending order of the array X value indices, and an exponentially weighted moving average b (i)  of the array X, calculated in descending order of the array X value indices, or an exponentially weighted moving average b′ (j)  of an array X′ containing the values of the array X in reverse order, calculated in ascending order of the array X′ value indices, where i, j are the array value indices, wherein 0≤i&lt;N, j=N−1−i, N is the array size. A computer system that implements said method, and a non-transitory computer readable medium comprising program instructions allowing for implementing said method.

FIELD OF THE INVENTION

The invention relates to data smoothing.

BACKGROUND OF THE INVENTION

There are many applications supposing collection of large arrays of input data requiring further smoothing, i.e. obtaining output values by means of separation of trends from noise and inconsistent values. Data smoothing is an integral part of various image editing techniques focused on eliminating specific defects (such as, for example, excessive detailing, scanning defects, scratches, dust).

There are a lot of smoothing techniques, and most of them use several input values to calculate the output one. The higher the smoothing degree, the more input values are to be used and the more calculations are to be performed.

Among the existing techniques, special mention should be made of exponentially weighted moving average characterized by recursive calculation of output values, whereby the amount of calculations does not depend on the degree of smoothing. Thus, this technique is much more efficient from the point of view of calculations.

However, at the same time, the exponentially weighted moving average is characterized by two main drawbacks: partial transfer of input data in the smoothing direction (on the graph it looks like absence of smoothing of the extreme left input value and a shift in the smoothing direction, on the image it looks like blurring of the original image with a shift to the right) and the exponential shape of the blur that does not look like a conventional Gaussian blur.

SUMMARY OF THE INVENTION

According to the present invention, the problem of the prior art is solved by transforming an array X of input values x_((i)) into an array Y of output values y_((i)) by calculating each value y_((i)) of the array Y as a function of at least an exponentially weighted moving average a_((i)) of the array X calculated in ascending order of the array X value indices, and an exponentially weighted moving average b_((i)) of the array X calculated in descending order of the array X value indices. An alternative to the latter is an exponentially weighted moving average b′_((j)) of the array X′ containing the values of the array X in reverse order, calculated in ascending order of the array X′ value indices, where i, j are the array value indices, 0≤i<N, j=N−1−i, and N is the array size.

The Summary of the Invention is provided to introduce the main concept of the invention in a simplified form that is further described below in the Detailed Description of the Invention. The Summary of the Invention is not intended to identify essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a pictorial diagram of an example embodiment of a computer system implementing the method of data smoothing

FIG. 2 is a block diagram illustrating an example of input data and a corresponding example of output data after smoothing

FIG. 3 is an example of data smoothing according to an embodiment of the present invention, shown in the form of graphs.

FIG. 4 is an example of data smoothing according to another embodiment of the present invention, shown in the form of graphs.

DETAILED DESCRIPTION OF THE INVENTION

In order to explain the invention, this description begins with more detailed information about the method of data smoothing using exponentially weighted moving average technique, emphasizing the points causing drawbacks of the method.

In the most general case, an exponentially weighted moving average is calculated according, to the equation

a _((i)) =a _((i−1)) *w+x _((i))*(1−w),

where i is an index of the value of the input value array, 0≤i<N, and N is the array size.

The said method results in partial transfer of the input data in the smoothing direction, i.e. in the direction of output values. This is because the exponentially weighted moving, average is calculated recursively, i.e. each new smoothed value a_((i)) is calculated as a weighted average of the current input value x_((i)) and the smoothed value a_((i−1)). Here, the subsequent input values have no effect on smoothing, therefore, smoothing is asymmetrical. The first input value x₍₀₎ is not smoothed since there is no smoothed value a⁽⁰⁻¹⁾ for it, so normally the input value itself is used instead of the smoothed one

a₍₀₎=x₍₀₎.

Another possible embodiment of smoothing using exponentially weighted moving average technique supposes smoothing of the first input value x₍₀₎ using a technique that does not require a smoothed value a_((i−1)) for calculation, which negatively affects the overall computational efficiency due to combination of techniques.

According to the claimed computer-implemented method of transforming the array X of the input values x_((i)) into the an array Y of output values y_((i)) instead of using just an exponentially weighted moving average for data smoothing, it is suggested to calculate each value y_((i)) of the array Y as a function of at least two exponentially weighted moving averages:

an exponentially weighted moving average a_((i)) of the array X, calculated in ascending order of the array X value indices, and

an exponentially weighted moving average b_((i)) of the array X, calculated in descending order of the array X value indices. As an alternative to the latter, an exponentially weighted moving average b′_((j)) of the array X′ containing the values of the array X in reverse order, calculated in ascending order of the array X′ value indices may be used, where i, j are the array value indices, wherein 0≤i<N, j=N−1−i, N is the array size.

Said alternative features together with other essential features of the method provide the same result within the method according to the present invention.

Therefore, the output value y_((i)) is determined based on at least two exponentially weighted moving averages calculated in two different directions of the array of input values x_((i)): in ascending order of the array X value indices and in descending order of said indices, which compensates the directed partial transfer of data in course of smoothing and therefore provides symmetry of smoothing with simultaneous smoothing of both extreme input values. This method allows for compensation of drawbacks of the conventional exponentially weighted moving average, while preserving its advantages. The result of smoothing becomes symmetrical, with the shape similar to Gaussian blur, while the method itself preserves high computational efficiency.

The phrase “at least two exponentially weighted moving averages” means that in some embodiments of the present invention, depending on the field of application of smoothing, the other variables may be used along with a_((i)) and b_((i))/b′_((j)) for calculation of the output value y_((i)), in particular the input values x_((i))/x′_((j)) of the array X/X′ per se, and not only as data for calculating a_((i)) and b_((i))/b′_((j)).

Depending on the desired degree of smoothing, different algorithms can be used for calculation of the exponentially weighted moving averages.

In general, the exponentially weighted moving average a_((i)) is calculated according to the equation

a _((i)) =a _((i−1)) *w+x _((i))*(1−w),

the exponentially weighted moving average b_((i)) is calculated according to the equation

b _((i)) =b _((i+1)) *w+x _((i))*(1−w),

and respectively the exponentially weighted moving average b′_((j)) is calculated according to the equation

b′ _((j)) =b′ _((j−1)) *w+x′ _((j))*(1−w),

where w is a smoothing coefficient having a value between 0 and 1, 0<w<1.

In another embodiment of the present invention, the exponentially weighted moving average a_((i)) is calculated according to the equation

a _((i)) =a _((i−1)) *s _((i)) +x _((i))*(1−s _((i))),

the exponentially weighted moving average b_((i)) is calculated according to the equation

b _((i)) =b _((i+1)) *s _((i)) +x _((i))*(1−s _((i))),

and, respectively, the exponentially weighted moving average b′_((j)) is calculated according to the equation

b′ _((j)) =b′ _((j−1)) *s′ _((j)) +x′ _((j))*(1−s′ _((j))),

where s_((i)) are the values of the array S of size N, being smoothing coefficients, s′_((j)) are the values of the array S′ of size N comprising the values of the array S in reverse order.

In one of the preferred embodiments of the present invention, the exponentially weighted moving average a_((i)) is calculated according to the equation

a _((i)) =a _((i−1)) *w+(x _((i)) +x _((i−1)))/2*(1−w),

the exponentially weighted moving average b_((i)) is calculated according to the equation

b _((i)) =b _((i+1)) *w+(x _((i)) +x _((i+1)))/2*(1−w),

and the exponentially weighted moving average b′_((j)) is calculated according to the equation

b′ _((j)) =b′ _((j−1)) *w+(x′ _((j)) +x′ _((j−1)))/2*(1−w),

where w is a smoothing coefficient having a value between 0 and 1, 0<w<1.

In this embodiment, the averages of two adjacent input values of the array (depending on the smoothing direction) are used instead of the input values of the array as input data for calculating the exponentially weighted moving averages a(i) and b_((i))/b′_((j)).

In another particular embodiment of the invention, the exponentially weighted moving average a_((i)) is calculated according to the equation

a _((i)) =a _((i−1)) *s _((i))+(x _((i)) +x _((i−1)))/2*(1−s _((i))),

the exponentially weighted moving average b_((i)) is calculated according to the equation

b _((i)) =b _((i+1)) *s _((i))+(x _((i)) +x _((i+1)))/2*(1−s _((i))),

and the exponentially weighted moving average b′_((j)) is calculated according to the equation

b′ _(j)) =b′ _((j−1)) *s′ _((j))+(x′ _((j)) +x′ _((j−1)))/2*(1−s′ _((j))),

where s_((i)) are the values of the array S of size N, being smoothing coefficients, s′_((j)) are the values of the array S′ of size N comprising the values of the array S in reverse order.

The array S can be used to change the degree of smoothing for individual values of the array X. Thus, the values x_((i)) corresponding to the larger value s_((i)), will be of less weight in the output data, i.e. will be smoothed more.

In one of particular embodiments of the present invention, each value y_((i)) of the array Y is calculated according to the equation

y _((i))=(a _((i)) +b _((i)))/2

or

y _((i))=(a _((i)) +b′ _((j)))/2.

In another particular embodiment of the present invention, each value y_((i)) of the array Y is calculated according to the equation

y _((i)) =abs(x _((i))−(a _((i)) +b _((i)))/2)̂g

or

y _((i)) =abs(x _((i))−(a _((i)) +b′ _((j)))/2)̂g

where g is an exponent, g>0.

The exponent g equalling 2, the equation represents a square of a difference, which is often used to estimate the mean squared error when evaluating the similarity of images. When g equals 1, the equation may be used to estimate the absolute difference. The exponent g being less than 1 allows to reduce the influence of large deviations from unsmoothed values and to increase the influence of small deviations. The values greater than 1 give the opposite effect.

This embodiment is applicable, for instance, in image editing for edge detection and sharpening.

In still another particular embodiment of the present invention, each value y_((i)) of the array Y is calculated according to the equation

y _((i))=max(min(x _((i)), max(a _((i)) , b _((i)))), min(a _((i)) , b _((i))))

or

y _((i))=max(min(x _((i)), max(a _((i)) , b′ _((j)))), min(a _((i)) , b′ _((j)))).

This embodiment is preferably used, for instance, in image editing for noise reduction, noise filtering, signal filtering.

In another particular embodiment of the present invention, each value y_((i)) of the array Y is calculated according to the equation

y _((i))=max(a _((i)) , b _((i)))

or

y _((i))=max(a _((i)) , b′ _((j))).

This embodiment is applicable, for example, in image processing for obtaining smoothed images with priority of higher values.

Another particular embodiment of the present invention is the calculation of each value y_((i)) of the array Y according to the equation

y _((i))=min(a _((i)) , b _((i)))

or

y _((i))=min(a _((i)) , b′ _((j))).

This embodiment is applicable, for example, in image processing for obtaining smoothed images with priority of lower values.

It should be noted that the above algorithms for calculation of a_((i)) and b_((i))/b′_((j)), as well as for calculation of the output values y_((i)) are the examples in the preferred embodiments of the present invention and are not intended for limiting its scope. As such, those skilled in the art will appreciate that other calculation algorithms can be used depending on the final purpose of smoothing.

Combining different algorithms for calculating exponentially weighted moving averages with different algorithms of output values calculation based thereon allows to obtain, for example, various image processing filters.

The present invention is described herein directly through a computer-implemented method of data smoothing, as well as through a computer system with program instructions implementing the said method, and a computer readable medium storing said program instructions that initiate implementation of the aspects of data smoothing method according to the present invention.

The aspects of the present invention are described herein with reference to the drawings.

FIG. 1 illustrates an example of a computer system that can implement the method of data smoothing as claimed. In the illustrated example, the computer system 100 comprises a processor 102 and a computer readable medium 104 communicatively connected with the processor 102. The computer readable medium stores program instructions executable by said processor 102 and initiating the input data smoothing based on the exponentially weighted moving average a_((i)) and the exponentially weighted moving average b_((i)).

The program instructions described herein are executable by at least one or more hardware logic components. Examples of possible types of hardware logic components that can be used (without limitation) include field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), systems-on-a-chip (SOCs), complex programmable logic devices (CPLDs), etc.

Program instructions for carrying out operations of the present invention may be represented by assembler code instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine-dependent instructions, set of micro commands, base software instructions, state data, or another source code or object code written in any combination of one or more programming languages, including object oriented programming languages such as Smalltalk, C++ or the like, and conventional procedural programming languages such as C or C-like programming languages.

The program instructions may be executed entirely on the user's computer, partly on the user's computer as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including local area network (LAN) and wide area network (WAN), or it can be connected to an external computer (for example, through the Internet using an Internet Service Provider).

In some embodiments, for example, in electronic circuitry, programmable logic devices, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) can execute computer readable program instructions optimizing the information about the state of such instructions for adjustment of electronic circuitry in order to implement the aspects of the present invention.

The computer readable medium includes volatile and non-volatile, removable and non-removable media applicable in any method or technology of storing such information as computer readable instructions, data structures, program modules, etc.

Computer readable medium may include random access memory (RAM), read-only memory (ROM), electrically-erasable programmable ROM (EEPROM), flash memory or another memory technology, CD-ROM, DVD format compact disc or another optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, as well as any other non-transmission medium that can be used to store information for access by a computing device. Said computer readable storage medium is a non-transitory one.

An example of input data and a corresponding example of output data after smoothing are illustrated in general terms as a block diagram in FIG. 2 for the case of editing a digital image 200 to be smoothed. The input values for smoothing are pixel colours of the said digital image 200. Program instructions stored in a computer readable medium 104 initiate the calculation of the exponentially weighted moving average a_((i)) of the array of the digital image 200 pixel colour input values, the calculation of the exponentially weighted moving average b_((i)) of the array of the digital image 200 pixel colour input values, and the subsequent calculation of the smoothed output values y_((i)) on the basis of a_((i)) and b_((i)). As a result, a smoothed digital image 202 is obtained.

FIG. 3 illustrates an example of smoothing of input colour values for a sequence of 26 pixels of the digital image 200, presented as graphs. This size of the row was selected for clearer illustration of smoothing according to the method of the present invention. The graph 300 represents an array X of the input colour values of a selected row of pixels. The graph 302 represents an exponentially weighted moving average a_((i)) calculated in ascending order of the array X value indices, wherein the equation a_((i))=a_((i−1))*w+x_((i))*(1−w) was used for calculation. The graph 304 represents an exponentially weighted moving average b_((i)) calculated in descending order of the array X value indices, wherein the equation b_((i))=b_((i+1))*w+x_((i))*(1−w) was used for calculation. The graph 306 represents an array Y of the output colour values for the selected row of pixels, wherein each output value y_((i)) was calculated as an average between a_((i)) and b_((i)). In practice, such combination of algorithms may be used to implement edge detection filter.

For illustrative purposes and in order to bring further clarification, the colour values of the eleventh pixel were selected. On the image, this region may be the edge of the depicted object. In this example the exponentially weighted moving average a₍₁₁₎ has a large deviation from the input value x₍₁₁₎, whereas the exponentially weighted moving average b₍₁₁₎, on the contrary, has relatively small deviation and approaches the input value x₍₁₁₎. Since the output value y₍₁₁₎ was calculated on the basis of both a₍₁₁₎ and b₍₁₁₎, the shifts in the smoothing direction were correspondingly compensated.

FIG. 4 illustrates another example of smoothing of a data array similar to the data array of the example in FIG. 3. The graph 400 represents an array X of the input colour values x_((i)) of a selected successive row of pixels. The graph 402 represents an exponentially weighted moving average a_((i)) calculated in ascending order of the array X value indices, where the equation a_((i))=a_((i−1))*w+(x_((i))+x_((i−1)))/2*(1−w) was used for calculation. The graph 404 represents an exponentially weighted moving average b_((i)) calculated in descending order of the array X value indices, where the equation b_((i))=b_((i+1))*w+(x_((i))+x_((i+1)))/2*(1−w) was used for calculation. The graph 406 represents an array Y of the output colour values y_((i)) of a selected row of pixels, wherein each output value y_((i)) was calculated, like in the previous example, as an average between a_((i)) and b_((i)). In practice, such combination of algorithms may also be used to implement edge detection and noise filters.

For illustrative purposes and in order to bring further clarification, a region from the third to the seventh pixel comprising the extreme input value x₍₅₎ was selected. In this case, the input data transfer in the smoothing direction (to the right (a₍₆₎) and to the left (b₍₄₎) respectively) relative to the input value x₍₅₎ is observed. Since the output value y₍₅₎ was calculated on the basis of both a₍₅₎ and b₍₅₎, the input data transfer to the right and to the left was compensated, whereby a symmetric blur was obtained.

The present invention and various specific embodiments thereof may be used in many technical fields, non-limiting examples of which are, in particular, commercial image editing tools, medicine, in particular, endoscopy and microscopy, statistical analysis programs, meteorological data processing, financial analysis, digital processing of acoustic and other signals, control of flying objects, motion stabilization, etc.

Besides the data illustrated and described as examples of input values characterising a digital image, the method of data smoothing as described herein may be applied to any type of data. Examples of other types of data include, but are not limited to, input data generated through natural user interface technologies, such as speech recognition, touch and stylus recognition, gesture recognition, gesture control, head and eye tracking, voice and speech, vision, touch, hover, and machine intelligence.

Although the examples of the method of data smoothing were described in a language specific to the structural features and/or methodological steps, it should be understood that the method of data smoothing as defined in the appended claims is not necessarily limited to the specific features or steps described above. Rather, the specific features and steps described above are disclosed as examples implementing the claims, and other equivalent features and steps can be encompassed by the claims of the present invention. 

1. A method of transforming an array X of input values x_((i)) into an array Y of output values y_((i)), comprising calculating each value y_((i)) of the array Y as a function at least of an exponentially weighted moving average a_((i)) of the array X, calculated in ascending order of the array X value indices, and an exponentially weighted moving average b_((i)) of the array X, calculated in descending order of the array X value indices, or an exponentially weighted moving average b′_((j)) of an array X′ containing the values of the array X in reverse order, calculated in ascending order of the array X′ value indices, where i, j are the array value indices, wherein 0≤i<N, j=N−1−i, N is the array size.
 2. The method of claim 1, characterized in that the method comprises calculating the exponentially weighted moving average a_((i)) according to the equation a _((i)) =a _((i−1)) *w+x _((i))*(1−w) and the exponentially weighted moving average b_((i)) according to the equation b _((i)) =b _((i+1)) *w+x _((i))*(1−w) or the exponentially weighted moving average b′_((j)) according to the equation b′ _((j)) =b′ _((j−1)) *w+x′ _((j))*(1−w), where w is a smoothing coefficient.
 3. The method of claim 1, characterized in that the method comprises calculating the exponentially weighted moving average a_((i)) according to the equation a _((i)) =a _((i−1)) *s _((i)) +x _((i))*(1−s _((i))) and the exponentially weighted moving average b_((i)) according to the equation b _((i)) =b _((i+1)) *s _((i)) +x _((i))*(1−s _((i))) or the exponentially weighted moving average b′_((j)) according to the equation b′ _((j)) =b′ _((j−1)) *s′ _((j)) +x′ _((j))*(1−s′ _((j))), where s_((i)) are the values of the array S of size N, being smoothing coefficients, s′_((j)) are the values of the array S′ of size N comprising the values of the array S in reverse order.
 4. The method of claim 1, characterized in that the method comprises calculating the exponentially weighted moving average a_((i)) according to the equation a _((i)) =a _((i−1)) *w+(x _((i)) +x _((i−1)))/2*(1−w) and the exponentially weighted moving average b_((i)) according to the equation b _((i)) =b _((i+1)) *w+(x _((i)) +x _((i+1)))/2*(1−w) or the exponentially weighted moving average b′_((j)) according to the equation b′ _((j)) =b′ _((j−1)) *w+(x′ _((j)) +x′ _((j−1)))/2*(1−w), where w is a smoothing coefficient.
 5. The method of claim 1, comprises calculating the exponentially weighted moving average a_((i)) according to the equation a _((i)) =a _((i−1)) *s _((i))+(x _((i)) +x _((i−1)))/2*(1−s _((i))) and the exponentially weighted moving average b_((i)) according to the equation b _((i)) =b _((i+1)) *s _((i))+(x _((i)) +x _((i+1)))/2*(1−s _((i))) or the exponentially weighted moving average b′_((j)) according to the equation b′ _(j)) =b′ _((j−1)) *s′ _((j))+(x′ _((j)) +x′ _((j−1)))/2*(1−s′ _((j))), where s_((i)) are the values of the array S of size N, being smoothing coefficients, s′_((j)) are the values of the array S′ of size N comprising the values of the array S in reverse order.
 6. The method of claim 1, characterized in that the method comprises calculating each value y_((i)) of the array Y according to the equation y _((i))=(a _((i)) +b _((i)))/2 or y _((i))=(a _((i)) +b′ _((j)))/2.
 7. The method of claim 1, characterized in that the method comprises calculating each value y_((i)) of the array Y according to the equation y _((i)) =abs(x _((i))−(a _((i)) +b _((i)))/2)̂g or y _((i)) =abs(x _((i))−(a _((i)) +b′ _((j)))/2)̂g, where g is an exponent, g>0.
 8. The method of claim 1, characterized in that the method comprises calculating each value y_((i)) of the array Y according to the equation y _((i))=max(min(x _((i)), max(a _((i)) , b _((i)))), min(a _((i)) , b _((i)))) or y _((i))=max(min(x _((i)), max(a _((i)) , b′ _((j)))), min(a _((i)) , b′ _((j)))).
 9. The method of claim 1, characterized in that the method comprises calculating each value y_((i)) of the array Y according to the equation y _((i))=max(a _((i)) , b _((i))) or y _((i))=max(a _((i)) , b′ _((j))).
 10. The method of claim 1, characterized in that the method comprises calculating each value y_((i)) of the array Y according to the equation y _((i))=min(a _((i)) , b _((i))) or y _((i))=min(a _((i)) , b′ _((j))).
 11. A computer system comprising at least one processor, at least one non-transitory computer readable medium communicatively connected with at least one processor, and program instructions stored on at least one computer readable medium, being executable by at least one processor and comprising program instructions for calculating each value y_((i)) of the array Y of output values as a function of at least an exponentially weighted moving average a_((i)) of the array X of input values x_((i)), calculated in ascending order of the array X value indices, and an exponentially weighted moving average b_((i)) of the array X of the input values x_((i)), calculated in descending order of the array X value indices, or an exponentially weighted moving average b′_((j)) of an array X′ containing the values of the array X in reverse order, calculated in ascending order of the array X′ value indices, where i, j are the array value indices, wherein 0≤i<N, j=N−1−i, N is the array size.
 12. The system of claim 11, wherein the program instructions comprise instructions for calculating the exponentially weighted moving average a_((i)) according to the equation a _((i)) =a _((i−1)) *w+x _((i))*(1−w) and the exponentially weighted moving average b_((i)) according to the equation b _((i)) =b _((i+1)) *w+x _((i))*(1−w) or the exponentially weighted moving average b′_((j)) according to the equation b′ _((j)) =b′ _((j−1)) *w+x′ _((j))*(1−w), where w is a smoothing coefficient.
 13. The system of claim 11, wherein the program instructions comprise instructions for calculating the exponentially weighted moving average a_((i)) according to the equation a _((i)) =a _((i−1)) *s _((i)) +x _((i))*(1−s _((i))) and the exponentially weighted moving average b_((i)) according to the equation b _((i)) =b _((i+1)) *s _((i)) +x _((i))*(1−s _((i))) or the exponentially weighted moving average b′_((j)) according to the equation b′ _((j)) =b′ _((j−1)) *s′ _((j)) +x′ _((j))*(1−s′ _((j))), where s_((i)) are the values of the array S of size N, being smoothing coefficients, s′_((j)) are the values of the array S′ of size N comprising the values of the array S in reverse order.
 14. The system of claim 11, wherein the program instructions comprise instructions for calculating the exponentially weighted moving average a_((i)) according to the equation a _((i)) =a _((i−1)) *w+(x _((i)) +x _((i−1)))/2*(1−w) and the exponentially weighted moving average b_((i)) according to the equation b _((i)) =b _((i+1)) *w+(x _((i)) +x _((i+1)))/2*(1−w) or the exponentially weighted moving average b′_((j)) according to the equation b′ _((j)) =b′ _((j−1)) *w+(x′ _((j)) +x′ _((j−1)))/2*(1−w), where w is a smoothing coefficient.
 15. The system of claim 11, wherein the program instructions comprise instructions for calculating the exponentially weighted moving average a_((i)) according to the equation a _((i)) =a _((i−1)) *s _((i))+(x _((i)) +x _((i−1)))/2*(1−s _((i))) and the exponentially weighted moving average b_((i)) according to the equation b _((i)) =b _((i+1)) *s _((i))+(x _((i)) +x _((i+1)))/2*(1−s _((i))) or the exponentially weighted moving average b′_((j)) according to the equation b′ _(j)) =b′ _((j−1)) *s′ _((j))+(x′ _((j)) +x′ _((j−1)))/2*(1−s′ _((j))), where s_((i)) are the values of the array S of size N, being smoothing coefficients, s′_((j)) are the values of the array S′ of size N comprising the values of the array S in reverse order.
 16. The system of claim 11, wherein the program instructions comprise instructions for calculating each value y_((i)) of the array Y according to the equation y _((i))=(a _((i)) +b _((i)))/2 or y _((i))=(a _((i)) +b′ _((j)))/2.
 17. The system of claim 11, wherein the program instructions comprise instructions for calculating each value y_((i)) of the array Y according to the equation y _((i)) =abs(x _((i))−(a _((i)) +b _((i)))/2)̂g or y _((i)) =abs(x _((i))−(a _((i)) +b′ _((j)))/2), where g is an exponent, g>0.
 18. The system of claim 11, wherein the program instructions comprise instructions for calculating each value y_((i)) of the array Y according to the equation y _((i))=max(min(x _((i)), max(a _((i)) , b _((i)))), min(a _((i)) , b _((i)))) or y _((i))=max(min(x _((i)), max(a _((i)) , b′ _((j)))), min(a _((i)) , b′ _((j)))).
 19. The system of claim 11, wherein the program instructions comprise instructions for calculating each value y_((i)) of the array Y according to the equation y _((i))=max(a _((i)) , b _((i))) or y _((i))=max(a _((i)) , b′ _((j))).
 20. The system of claim 11, wherein the program instructions comprise instructions for calculating each value y_((i)) of the array Y according to the equation y _((i))=min(a _((i)) , b _((i))) or y _((i))=min(a _((i)) , b′ _((j))).
 21. One or more non-transitory computer readable storage medium comprising program instructions stored thereon, comprising program instructions for calculating each value y_((i)) of an array Y of output values as a function of at least an exponentially weighted moving average a_((i)) of the array X of input values x_((i)), calculated in ascending order of the array X value indices, and an exponentially weighted moving average b_((i)) of the array X of the input values x_((i)), calculated in descending order of the array X value indices, or an exponentially weighted moving average b′_((j)) of an array X′ containing the values of the array X in reverse order, calculated in ascending order of the array X′ value indices, where i, j are the array value indices, wherein 0≤i<N, j=N−1−i, N is the array size.
 22. One or more non-transitory computer readable storage medium of claim 21, wherein the program instructions comprise instructions for calculating the exponentially weighted moving average a_((i)) according to the equation a _((i)) =a _((i−1)) *w+x _((i))*(1−w) and the exponentially weighted moving average b_((i)) according to the equation b _((i)) =b _((i+1)) *w+x _((i))*(1−w) or the exponentially weighted moving average b′_((j)) according to the equation b′ _((j)) =b′ _((j−1)) *w+x′ _((j))*(1−w), where w is a smoothing coefficient.
 23. One or more non-transitory computer readable storage medium of claim 21, wherein the program instructions comprise instructions for calculating the exponentially weighted moving average a_((i)) according to the equation a _((i)) =a _((i−1)) *s _((i)) +x _((i))*(1−s _((i))) and the exponentially weighted moving average b_((i)) according to the equation b _((i)) =b _((i+1)) *s _((i)) +x _((i))*(1−s _((i))) or the exponentially weighted moving average b′_((j)) according to the equation b′ _((j)) =b′ _((j−1)) *s′ _((j)) +x′ _((j))*(1−s′ _((j))), where s_((i)) are the values of the array S of size N, being smoothing coefficients, s′_((j)) are the values of the array S′ of size N comprising the values of the array S in reverse order.
 24. One or more non-transitory computer readable storage medium of claim 21, wherein the program instructions comprise instructions for calculating the exponentially weighted moving average a_((i)) according to the equation a _((i)) =a _((i−1)) *w+(x _((i)) +x _((i−1)))/2*(1−w) and the exponentially weighted moving average b_((i)) according to the equation b _((i)) =b _((i+1)) *w+(x _((i)) +x _((i+1)))/2*(1−w) or the exponentially weighted moving average b′_((j)) according to the equation b′ _((j)) =b′ _((j−1)) *w+(x′ _((j)) +x′ _((j−1)))/2*(1−w), where w is a smoothing coefficient.
 25. One or more non-transitory computer readable storage medium of claim 21, wherein the program instructions comprise instructions for calculating the exponentially weighted moving average a_((i)) according to the equation a _((i)) =a _((i−1)) *s _((i))+(x _((i)) +x _((i−1)))/2*(1−s _((i))) and the exponentially weighted moving average b_((i)) according to the equation b _((i)) =b _((i+1)) *s _((i))+(x _((i)) +x _((i+1)))/2*(1−s _((i))) or the exponentially weighted moving average b′_((j)) according to the equation b′ _(j)) =b′ _((j−1)) *s′ _((j))+(x′ _((j)) +x′ _((j−1)))/2*(1−s′ _((j))), where s_((i)) are the values of the array S of size N, being smoothing coefficients, s′_((j)) are the values of the array S′ of size N comprising the values of the array S in reverse order.
 26. One or more non-transitory computer readable storage medium of claim 21, wherein the program instructions comprise instructions for calculating each value y_((i)) of the array Y according to the equation y _((i))=(a _((i)) +b _((i)))/2 or y _((i))=(a _((i)) +b′ _((j)))/2.
 27. One or more non-transitory computer readable storage medium of claim 21, wherein the program instructions comprise instructions for calculating each value y_((i)) of the array Y according to the equation y _((i)) =abs(x _((i))−(a _((i)) +b _((i)))/2)̂g or y _((i)) =abs(x _((i))−(a _((i)) +b′ _((j)))/2)̂g, where g is an exponent, g>0.
 28. One or more non-transitory computer readable storage medium of claim 21, wherein the program instructions comprise instructions for calculating each value y_((i)) of the array Y according to the equation y _((i))=max(min(x _((i)), max(a _((i)) , b _((i)))), min(a _((i)) , b _((i)))) or y _((i))=max(min(x _((i)), max(a _((i)) , b′ _((j)))), min(a _((i)) , b′ _((j)))).
 29. One or more non-transitory computer readable storage medium of claim 21, wherein the program instructions comprise instructions for calculating each value y_((i)) of the array Y according to the equation y _((i))=max(a _((i)) , b _((i))) or y _((i))=max(a _((i)) , b′ _((j))).
 30. One or more non-transitory computer readable storage medium of claim 21, wherein the program instructions comprise instructions for calculating each value y_((i)) of the array Y according to the equation y _((i))=min(a _((i)) , b _((i))) or y _((i))=min(a _((i)) , b′ _((j))). 